-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat($httpBackend): flush requests in desired order #14967
Conversation
It was impossible to flush pending requests in desired order. Now it is possible because you can specify a `start` number.
@@ -1788,24 +1788,29 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) { | |||
* @ngdoc method | |||
* @name $httpBackend#flush | |||
* @description | |||
* Flushes all pending requests using the trained responses. | |||
* Flushes pending requests using the trained responses in the order they arrived. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention the start/skip
parameter in the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll do.
(I am not a native speaker so I will be thankful to get any idea about the text.)
I think this is a nice addition. Left some (mostly) minor comments. |
@gkalpak, I've made changes. |
This introduces a breaking change as "skip" is now the second argument, no? |
@Narretz, do you mean due to the changes |
Only Since this is not critical (i.e. it is an extra feature, not a fix), I am fine landing it in 1.6 only (but I wouldn't mark it as a breaking change). |
LGTM (as long as Travis is happy). |
Okay, since the digest parameter is private I'm fine with landing this in 1.5. Can you add |
@dizel3d Then just add |
Made changes according to results of PR review. Related angular#13717
1bcb28f
to
97ef447
Compare
@Narretz Done! |
LGTM |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feature
What is the current behavior? (You can also link to an open issue here)
#13717 We are currently unable to test what happens if two HTTP requests complete in a different order with the current API.
What is the new behavior (if this is a feature change)?
Now
$httpBackend.flush
has the second parameterstart
. So you can flush any range of pending requests array. Hence you can flush requests in a different order.Does this PR introduce a breaking change?
No.
Please check if the PR fulfills these requirements
Other information:
It was impossible to flush pending requests in desired order.
Now it is possible because you can specify a
start
number.